package main

import (
	"fmt"
	"sync"
)

func main() {
	var b chan int = make(chan int,2 )
	var wg sync.WaitGroup
	b<-10//因为设置了信道的缓冲区为16，所以能够提前向信道中传值
	b<-1
	wg.Add(1)
	go func() {
		defer wg.Done()
		x:=<-b
		fmt.Println("接收到了信道值",x)
	}()
	wg.Wait()
}
